package org.jumiz.framework.base.support;

import lombok.Data;
import org.jumiz.framework.base.reflect.BeanDefinition;

import java.lang.reflect.Field;

/**
 * 构建sql
 * @author Jumiz
 */
public interface SqlBuilder {

    /**
     * 构建可执行sql.
     * @param beanDefinition
     * @return
     */
    default SqlResult buildPrepareSql(BeanDefinition beanDefinition) {
        return null;
    };

    /**
     * 获取数据库表名称
     * @param entityClass
     * @param <T>
     * @return
     */
    default  <T> String getTableName(Class<T> entityClass) {
        return null;
    };

    default  <T> String getColumnName(Field field) {
        return null;
    };

    @Data
    public static class SqlResult {
        private String sql;
        private Object[] params;
    }

}

